﻿@model Propro.Models.addMember

@foreach (var item in Model.Members)
{

    @Html.DisplayFor(modelItem => item.UserName)
    if (item.UserName.Equals(User.Identity.Name) && User.IsInRole("Project" + Model.ProjectId) && Model.Members.Count > 1)
    {
        using (Html.BeginForm("leaveProject", "Projects"))
        {
             @Html.HiddenFor(model => model.ProjectId)
            <input type="submit" value="leave project" />
        }
    }
    <hr />
}

@if (User.IsInRole("Project" + Model.ProjectId))
{
    using (Html.BeginForm("addMember", "Projects"))
    {

    @Html.HiddenFor(model => model.ProjectId)
        
    <div class="editor-label">
        Add member
    </div>
    <div class="editor-field">
        @Html.DropDownList("SelectedMemberId", new SelectList(Model.NotMembers, "UserId", "UserName"))
        <input type="submit" value="add" />
    </div>
    }

}



